var _downloadList = {

    "building": {url: "texture/huhuai/building1.png", ratio: 1},
    "building-1": {url: "texture/huhuai/building/dilou1.png", ratio: 1},
    "building-2": {url: "texture/huhuai/building/dilou2.png", ratio: 1},
    "building-3": {url: "texture/huhuai/building/dilou3.png", ratio: 1},
    "building-4": {url: "texture/huhuai/building/gaolou1.png", ratio: 1},
    "building-5": {url: "texture/huhuai/building/gaolou2.png", ratio: 1},
    "building-6": {url: "texture/huhuai/building/gaolou3.png", ratio: 1},
    //汽车图标
    "huhuai_car1": {url: "texture/huhuai/cars/car1.png", ratio: 3},
    "huhuai_biandaox3": {url: "texture/huhuai/cars/shigu-biandao-oval@3x.png", ratio: 0.5},

    //抛锚小marker
    "near-paomaox3": {url: "texture/huhuai/paomao/near-paomaox3.png", ratio: 2},
    //抛锚上传信息label，危险闪光报警灯和gps
    'paomao-hazard': {url: "texture/huhuai/event-all/paomao-sensor-hazard@3x.png", ratio: 2},
    'paomao-door': {url: "texture/huhuai/event-all/paomao-sensor-door@3x.png", ratio: 2},
    //抛锚下载顶标
    'paomao-down': {url: "texture/huhuai/event-all/paomao-message-down.png", ratio: 1},
    //抛锚上传顶标
    'paomao-up': {url: "texture/huhuai/event-all/paomao-message-up.png", ratio: 1},

    //湿滑上传信息label，abs和速度
    'shihua-abs': {url: "texture/huhuai/event-all/shihua-sensor-ABS@3x.png", ratio: 2},
    'shihua-speed': {url: "texture/huhuai/event-all/shihua-sensor-speed@3x.png", ratio: 2},
    //湿滑下载顶标
    'shihua-down': {url: "texture/huhuai/event-all/shihua-message-down.png", ratio: 1},
    //湿滑上传顶标
    'shihua-up': {url: "texture/huhuai/event-all/shihua-message-up.png", ratio: 1},

    //事故小marker
    "near-shigux3": {url: "texture/huhuai/events2/near-shigux3.png", ratio: 2},
    //事故上传信息label，gps和airbag
    'shigu-abs': {url: "texture/huhuai/event-all/shigu-sensor-GPS@3x.png", ratio: 2},
    'shigu-airbag': {url: "texture/huhuai/event-all/shigu-sensor-airbag@3x.png", ratio: 2},
    //湿滑下载顶标
    'shigu-down': {url: "texture/huhuai/event-all/shigu-message-down.png", ratio: 1},
    //湿滑上传顶标
    'shigu-up': {url: "texture/huhuai/event-all/shigu-message-up.png", ratio: 1}
};

var ImageDownloader = {
    beginDownload: function (map) {
        for (var key in _downloadList) {
            (function (name, path, map) {
                map.loadImage(path.url, function (error, image) {
                    if (error) throw error;
                    map.addImage(name, image, {pixelRatio: path.ratio});
                });
            })(key, _downloadList[key], map);

        }
    }
}

export default ImageDownloader;
